<?php

require_once dirname(__FILE__).'/../lib/member_appointmentGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/member_appointmentGeneratorHelper.class.php';

/**
 * Member_appointment actions.
 *
 * @package    docplus.co.za
 * @subpackage Member_appointment
 * @author     Fox Matuku
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class Member_appointmentActions extends autoMember_appointmentActions
{

    public function preExecute()
    {
        $this->getUser()->setCurrentRoute("member_appointment");
        if ($this->getUser()->getType() == "member")
        {
            $this->MemberId = $this->getUser()->getMember()->getId();
        }
        else
        {
            $this->MemberId = $this->getUser()->getMemberId();
        }
        parent::preExecute();
    }

    protected function buildQuery()
    {
        $query = parent::buildQuery();
        $query->addWhere('a.Member_id = ?', $this->MemberId);
        return $query;
    }
}
